package com.mszlu.blog.utils;

import com.mszlu.blog.dao.pojo.SysUser;

/**
 * @Package: com.mszlu.blog.utils
 * @ClassName: UserThreadLocal
 * @Author: 陈威
 * @CreateTime: 2021/9/2 9:26
 * @Description:
 */
public class UserThreadLocal {
    private UserThreadLocal(){}
    //线程变量隔离
    public static final ThreadLocal<SysUser> LOCAL=new ThreadLocal();

    public static void put(SysUser sysUser){
        LOCAL.set(sysUser);
    }

    public static SysUser get(){
        return LOCAL.get();
    }
    public static void remove(){
        LOCAL.remove();
    }

}